<!DOCTYPE html>
<html>
<head >
    <meta charset="UTF-8">
    <link href="/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="/css/font-awesome.min.css" />
    <link rel="stylesheet" href="/css/community.css" />
    <!--[if lt IE 9]>
    <script src="/js/respond.min.js"></script>
    <![endif]-->
</head>
<body>

    <div class="main-content main-contentArticle" id="contentArticle">
            <div class="row">
                <div class="col-xs-12">
                    <div class="widget wgreen">

                        <div class="widget-head">
                            <div class="pull-left">内容</div>
                            <div class="widget-icons pull-right">

                                <!--<a href="#" class="wclose"><i class="icon-remove"></i></a>-->
                                <button type="button" class="closer"><span >×</span></button>
                            </div>
                            <div class="clearfix"></div>
                        </div>

                        <div class="widget-content">
                            <div class="padd">
                                <!-- Form starts.  -->
                                <form class="form-horizontal" role="form" method="post" action="/article/<%=method%>">
                                    <input type="hidden" name="_id" value="<%=article._id?article._id:''%>" >
                                    <input type="hidden" name="user_id" value="<%=user._id%>" >
                                    <div class="form-group">
                                        <label class="col-lg-4 control-label">文章标题</label>
                                        <div class="col-lg-8">
                                            <input type="text" class="form-control" placeholder="最大长度为300" name="articleTitle" value="<%=article.articleTitle?article.articleTitle:''%>">
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-lg-4 control-label">排序号</label>
                                        <div class="col-lg-8">
                                            <input type="text" class="form-control" placeholder="越大越靠前" name="order_by" value="<%=article.order_by?article.order_by:''%>">
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-lg-4 control-label">是否推荐</label>
                                        <div class="col-lg-8">
                                            <input type="radio" name="is_recommend" value="1" <%=article.is_recommend?'checked':''%>>是</input>
                                            <input type="radio" name="is_recommend" value="0" <%=!(article.is_recommend)?'checked':''%>>否</input>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-lg-4 control-label">父栏目</label>
                                        <div class="col-lg-8">
                                            <ul class="nav nav-list">
                                                <%
                                                if(categories && categories.length){
                                                for(var i=0;i<categories.length;i++){
                                                    var category = categories[i];
                                                %>
                                                <li><a href="#" class="dropdown-toggle"><input type="radio" name="category_id" value="<%=category._id%>" <%=(category._id&&article.category_id)?(category._id.toString() == article.category_id._id.toString()?'checked':''):''%>/> <span class="menu-text"><%= category.name%></span> <b class="arrow icon-angle-down"></b> </a>
                                                    <%
                                                    if(category.children && category.children.length){
                                                    %>
                                                    <ul class="submenu">
                                                        <%
                                                        for(var j=0;j<category.children.length;j++){
                                                            var subCategory = category.children[j];
                                                        %>
                                                        <li><a href="#"> <input type="radio" name="category_id" value="<%=subCategory._id%>" <%=(subCategory._id&&article.category_id)?(subCategory._id.toString() == article.category_id._id.toString()?'checked':''):''%>/> <%=subCategory.name%></a> </li>
                                                        <%
                                                        if(subCategory.children && subCategory.children.length){
                                                        for(var m=0;m<subCategory.children.length;m++){
                                                            var thirdCategory = subCategory.children[m];
                                                        %>s
                                                        <li> <a href="#"> <input type="radio" name="category_id" value="<%=thirdCategory._id%>" <%=(thirdCategory._id&&article.category_id)?(thirdCategory._id.toString() == article.category_id._id.toString()?'checked':''):''%>/> <%=thirdCategory.name%></a> </li>
                                                        <%
                                                        }
                                                        }
                                                        }
                                                        %>
                                                    </ul>
                                                    <%
                                                    }
                                                    %>
                                                    <%
                                                    }
                                                    }
                                                    %>
                                            </ul>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-lg-4 control-label">功能介绍</label>
                                        <div class="col-lg-8">
                                            <textarea class="form-control" rows="3" placeholder="最大长度为500" name="functionDescription"><%=article.functionDescription?article.functionDescription:''%></textarea>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-lg-4 control-label">综合示例</label>
                                        <div class="col-lg-8">
                                            <textarea class="form-control" rows="3" placeholder="" name="articleExamples"><%=article.articleExamples?article.articleExamples:''%></textarea>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-4 control-label">面试题</label>
                                        <div class="col-lg-8">
                                            <textarea class="form-control" rows="3" placeholder="" name="jobInterview"><%=article.jobInterview?article.jobInterview:''%></textarea>
                                        </div>
                                    </div>


                                   <!-- <div class="form-group">
                                        <label class="col-lg-4 control-label">CLEditor</label>
                                        <div class="col-lg-8">
                                            <div class="wysiwyg-toolbar btn-toolbar center wysiwyg-style2"> <div class="btn-group">  <a class="btn btn-sm  dropdown-toggle" data-toggle="dropdown" title="" data-original-title="Font"><i class="icon-font"></i><i class="icon-angle-down icon-on-right"></i></a>  <ul class="dropdown-menu dropdown-light"> <li><a data-edit="fontName Arial" style="font-family:'Arial'">Arial</a></li>  <li><a data-edit="fontName Courier" style="font-family:'Courier'">Courier</a></li>  <li><a data-edit="fontName Comic Sans MS" style="font-family:'Comic Sans MS'">Comic Sans MS</a></li>  <li><a data-edit="fontName Helvetica" style="font-family:'Helvetica'">Helvetica</a></li>  <li><a data-edit="fontName Open Sans" style="font-family:'Open Sans'">Open Sans</a></li>  <li><a data-edit="fontName Tahoma" style="font-family:'Tahoma'">Tahoma</a></li>  <li><a data-edit="fontName Verdana" style="font-family:'Verdana'">Verdana</a></li>  </ul> </div> <div class="btn-group">  <a class="btn btn-sm  dropdown-toggle" data-toggle="dropdown" title="" data-original-title="Font Size"><i class="icon-text-height"></i>&nbsp;<i class="icon-angle-down icon-on-right"></i></a>  <ul class="dropdown-menu dropdown-light">  <li><a data-edit="fontSize 1"><font size="1">Small</font></a></li>  <li><a data-edit="fontSize 3"><font size="3">Normal</font></a></li>  <li><a data-edit="fontSize 5"><font size="5">Huge</font></a></li>  </ul>  </div> <div class="btn-group">  <a class="btn btn-sm btn-info" data-edit="bold" title="" data-original-title="Bold (Ctrl/Cmd+B)"><i class="icon-bold"></i></a>  <a class="btn btn-sm btn-info" data-edit="italic" title="" data-original-title="Italic (Ctrl/Cmd+I)"><i class="icon-italic"></i></a>  <a class="btn btn-sm btn-info" data-edit="strikethrough" title="" data-original-title="Strikethrough"><i class="icon-strikethrough"></i></a>  <a class="btn btn-sm btn-info" data-edit="underline" title="" data-original-title="Underline"><i class="icon-underline"></i></a>  </div> <div class="btn-group">  <a class="btn btn-sm btn-success" data-edit="insertunorderedlist" title="" data-original-title="Bullet list"><i class="icon-list-ul"></i></a>  <a class="btn btn-sm btn-success" data-edit="insertorderedlist" title="" data-original-title="Number list"><i class="icon-list-ol"></i></a>  <a class="btn btn-sm btn-purple" data-edit="outdent" title="" data-original-title="Reduce indent (Shift+Tab)"><i class="icon-indent-left"></i></a>  <a class="btn btn-sm btn-purple" data-edit="indent" title="" data-original-title="Indent (Tab)"><i class="icon-indent-right"></i></a>  </div> <div class="btn-group">  <a class="btn btn-sm btn-primary" data-edit="justifyleft" title="" data-original-title="Align Left (Ctrl/Cmd+L)"><i class="icon-align-left"></i></a>  <a class="btn btn-sm btn-primary" data-edit="justifycenter" title="" data-original-title="Center (Ctrl/Cmd+E)"><i class="icon-align-center"></i></a>  <a class="btn btn-sm btn-primary" data-edit="justifyright" title="" data-original-title="Align Right (Ctrl/Cmd+R)"><i class="icon-align-right"></i></a>  <a class="btn btn-sm btn-inverse" data-edit="justifyfull" title="" data-original-title="Justify (Ctrl/Cmd+J)"><i class="icon-align-justify"></i></a>  </div> <div class="btn-group">  <div class="inline position-relative"> <a class="btn btn-sm btn-pink dropdown-toggle" data-toggle="dropdown" title="" data-original-title="Hyperlink"><i class="icon-link"></i></a>  <div class="dropdown-menu dropdown-caret pull-right">							<div class="input-group">								<input class="form-control" placeholder="URL" type="text" data-edit="createLink">								<span class="input-group-btn">									<button class="btn btn-sm btn-primary" type="button">Add</button>								</span>							</div>						</div> </div> <a class="btn btn-sm btn-pink" data-edit="unlink" title="" data-original-title="Remove Hyperlink"><i class="icon-unlink"></i></a>  </div> <div class="btn-group">  <div class="inline position-relative"> <a class="btn btn-sm btn-success dropdown-toggle" data-toggle="dropdown" title="" data-original-title="Insert picture"><i class="icon-picture"></i></a>  <div class="dropdown-menu dropdown-caret pull-right">							<div class="input-group">								<input class="form-control" placeholder="Image URL" type="text" data-edit="insertImage">								<span class="input-group-btn">									<button class="btn btn-sm btn-primary" type="button">Insert</button>								</span>							</div><div class="space-2"></div>							 <div class="center">								<button class="btn btn-sm btn-success wysiwyg-choose-file" type="button"><i class="icon-file"></i> Choose Image …</button>								<input type="file" data-edit="insertImage">							  </div> </div> </div> </div> <div class="btn-group">  <select class="hide wysiwyg_colorpicker" title="Change Color" style="display: none;">  <option value="#ac725e">#ac725e</option>  <option value="#d06b64">#d06b64</option>  <option value="#f83a22">#f83a22</option>  <option value="#fa573c">#fa573c</option>  <option value="#ff7537">#ff7537</option>  <option value="#ffad46">#ffad46</option>  <option value="#42d692">#42d692</option>  <option value="#16a765">#16a765</option>  <option value="#7bd148">#7bd148</option>  <option value="#b3dc6c">#b3dc6c</option>  <option value="#fbe983">#fbe983</option>  <option value="#fad165">#fad165</option>  <option value="#92e1c0">#92e1c0</option>  <option value="#9fe1e7">#9fe1e7</option>  <option value="#9fc6e7">#9fc6e7</option>  <option value="#4986e7">#4986e7</option>  <option value="#9a9cff">#9a9cff</option>  <option value="#b99aff">#b99aff</option>  <option value="#c2c2c2">#c2c2c2</option>  <option value="#cabdbf">#cabdbf</option>  <option value="#cca6ac">#cca6ac</option>  <option value="#f691b2">#f691b2</option>  <option value="#cd74e6">#cd74e6</option>  <option value="#a47ae2">#a47ae2</option>  <option value="#444444">#444444</option>  </select><div class="dropdown dropdown-colorpicker"><a data-toggle="dropdown" class="dropdown-toggle" href="#"><span class="btn-colorpicker" style="background-color:#ac725e" data-original-title="" title=""></span></a><ul class="dropdown-menu dropdown-caret pull-right"><li><a class="colorpick-btn selected" href="#" style="background-color:#ac725e;" data-color="#ac725e"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#d06b64;" data-color="#d06b64"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#f83a22;" data-color="#f83a22"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#fa573c;" data-color="#fa573c"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#ff7537;" data-color="#ff7537"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#ffad46;" data-color="#ffad46"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#42d692;" data-color="#42d692"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#16a765;" data-color="#16a765"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#7bd148;" data-color="#7bd148"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#b3dc6c;" data-color="#b3dc6c"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#fbe983;" data-color="#fbe983"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#fad165;" data-color="#fad165"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#92e1c0;" data-color="#92e1c0"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#9fe1e7;" data-color="#9fe1e7"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#9fc6e7;" data-color="#9fc6e7"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#4986e7;" data-color="#4986e7"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#9a9cff;" data-color="#9a9cff"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#b99aff;" data-color="#b99aff"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#c2c2c2;" data-color="#c2c2c2"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#cabdbf;" data-color="#cabdbf"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#cca6ac;" data-color="#cca6ac"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#f691b2;" data-color="#f691b2"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#cd74e6;" data-color="#cd74e6"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#a47ae2;" data-color="#a47ae2"></a></li><li><a class="colorpick-btn" href="#" style="background-color:#444444;" data-color="#444444"></a></li></ul></div>  <input style="display:none;" disabled="" class="hide" type="text" data-edit="foreColor">  </div> <div class="btn-group">  <a class="btn btn-sm btn-grey" data-edit="undo" title="" data-original-title="Undo (Ctrl/Cmd+Z)"><i class="icon-undo"></i></a>  <a class="btn btn-sm btn-grey" data-edit="redo" title="" data-original-title="Redo (Ctrl/Cmd+Y)"><i class="icon-repeat"></i></a>  </div> </div>
                                            <div class="wysiwyg-editor" id="editor" contenteditable="true"></div>
                                            <input type="hidden" name="wysiwyg-value">
                                            <div class="hr hr-double dotted"></div>
                                        </div>
                                    </div>-->

                                    <hr>
                                    <div class="form-group">
                                        <div class="col-lg-offset-1 col-lg-9" style="text-align: center">
                                            <button type="submit" class="btn btn-primary btn-lg" style="margin-right: 10px;">确定</button>
                                            <button type="reset" class="btn btn-primary btn-lg " >重置</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <div class="widget-foot">
                            <!-- Footer goes here -->
                        </div>
                    </div>
                </div>

            </div>

    </div>
</body>
</html>
<script src="/js/jquery-2.0.3.min.js"></script>
<script src="/js/bootstrap-wysiwyg.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/ace.js"></script>
<script src="/js/ace-elements.min.js"></script>
<script type="text/javascript">
    jQuery(function($) {
        if($(".modal").css("display")=="block") {
            $('#editor').ace_wysiwyg({
                toolbar: [
                    {
                        name: 'font',
                        title: 'Custom tooltip',
                        values: ['Some Font!', 'Arial', 'Verdana', 'Comic Sans MS', 'Custom Font!']
                    },
                    null,
                    {
                        name: 'fontSize',
                        title: 'Custom tooltip',
                        values: {1: 'Size#1 Text', 2: 'Size#1 Text', 3: 'Size#3 Text', 4: 'Size#4 Text', 5: 'Size#5 Text'}
                    },
                    null,
                    {name: 'bold', title: 'Custom tooltip'},
                    {name: 'italic', title: 'Custom tooltip'},
                    {name: 'strikethrough', title: 'Custom tooltip'},
                    {name: 'underline', title: 'Custom tooltip'},
                    null,
                    'insertunorderedlist',
                    'insertorderedlist',
                    'outdent',
                    'indent',
                    null,
                    {name: 'justifyleft'},
                    {name: 'justifycenter'},
                    {name: 'justifyright'},
                    {name: 'justifyfull'},
                    null,
                    {
                        name: 'createLink',
                        placeholder: 'Custom PlaceHolder Text',
                        button_class: 'btn-purple',
                        button_text: 'Custom TEXT'
                    },
                    {name: 'unlink'},
                    null,
                    {
                        name: 'insertImage',
                        placeholder: 'Custom PlaceHolder Text',
                        button_class: 'btn-inverse',
                        //choose_file:false,//hide choose file button
                        button_text: 'Set choose_file:false to hide this',
                        button_insert_class: 'btn-pink',
                        button_insert: 'Insert Image'
                    },
                    null,
                    {
                        name: 'foreColor',
                        title: 'Custom Colors',
                        values: ['red', 'green', 'blue', 'navy', 'orange']
                        /**
                         You change colors as well
                         */
                    },
                /**null,
                 {
                           name:'backColor'
                       },*/
                    null,
                    {name: 'undo'},
                    {name: 'redo'},
                    null,
                    'viewSource'
                ],
                //speech_button:false,//hide speech button on chrome

                'wysiwyg': {
                    hotKeys: {} //disable hotkeys
                }

            }).prev().addClass('wysiwyg-style2');


            //handle form onsubmit event to send the wysiwyg's content to server



        }
    });


</script>
